Overview: Forms are used to capture and display data. You can customize forms to modify their layout and behavior. The form adjusts itself based on screen size. All system and custom entities have at least one form and one mobile form.
Multiple Forms: You can have multiple forms (both main and mobile) for an entity and can assign security roles to them. A main form is used by browsers, Outlook and tablets. If a user has rights to multiple forms then they can choose the form to use (upper-left corner of the record). After selecting a form, CRM will display that same form for the entity until the user signs out or chooses a different form.
Security: Forms can be assigned to Security Roles to control the groups of Users or Teams who have access to a specific form. The form a user sees is based on security roles and form order.
CRM 2013 Form Features: Business Process Flows, Business Rules, Support for Tablets, Command Bar (replaces ribbon), 29 entities use the new form presentation (e.g., Account, Opportunity, Case). You can use a new Merge Forms feature to bring in all components from a previous form to one of the new forms.
Form Structure: Header, Footer and Body.
Header and Footer: Fixed position; Up to 4 fields; Cannot be removed but they don't need to include anything. Fields in the header are tiles; users can update the values. Fields in the footer are read-only. You can display a Web Resources or IFRAME in the header and footer. In the header, doing this turns the field tiles into read-only text.
Form Body: Consists of tabs, columns and sections.
Tabs: A form can contain one or more tabs. They're aligned vertically for browsers, horizontally for tablets. Properties include: Name (used in JavaScript), Label, Show label on form (yes/no), Expand by default (yes/no), Visible by default (yes/no). Formatting options: Up to three columns; Can set the screen width percentage each column is allotted.
Sections: Sections can contain fields, sub-grids, charts, Notes control (Social Pane), IFrames, Web Resources, Bing maps, Spacers. A section can include 1 to 4 columns; they're evenly divided. Field alignment can be left, right or middle (center). Components in a section can span one or more columns. You can set the width of the field labels in pixels.
Fields: A red padlock next to a field indicates that you can't remove the field (it's required, was locked, has script dependencies).
Form Properties: Name, Description, Show navigation items (yes/no; Nav bar will show related records), Show image in form (yes/no), Max width (pixels; 1900 is the default)
Definitions:
Main Form: Used by browsers, Outlook and tablets.
Mobile Form: Used by mobile phones. Mobile clients use the first form for an entity (based on order and the user's security roles) and the user cannot switch to a different form.
Classic Forms: Several entities in CRM 2013 use the same layout and elements as in CRM 2011; These forms have a toolbar or ribbon, do not support Business Process Flows and Business Rules. Examples include Article, Connection, Price List and Quote Product.
Social Pane: Also called the Notes section
Responsive Design: Tabs are displayed based on the width of the browser window. This is known as responsive design. The columns expand/contract based on screen width.
Form Messages and Meaning (in the form editor):
"Header tiles don't work with the current customizations and will be displayed in compatibility view. With header tiles, you can't have more than four fields or multiline fields, and you can't use web resources and inline frames."
This message appears if you add a multi-line field, a web resource or IFRAME to the header. You can have one of these but the field tiles that are normally editable become read-only.
Creating new forms: Default name "New Form"; For the new form, CRM copies the form that is highest in the form order; You can use "Save As" to copy a form
Form Fields: Drag and drop fields onto the form; Can create a new field from the Field Explorer;
Display Properties: Label, Field is read-only (y/n), Lock field on the form (y/n), Visible by default (y/n)
Formatting Properties: Set the number of columns the field should span
Events and Business Rules Properties: You can add JavaScript functions to the OnChange event for a field on the Events tab of the Field Properties dialog box. On the Business Rules tab, you can view, add or modify Business Rules that involve this field.
Composite Fields: New in CRM 2013; Concatenates the values of multiple text fields together as one text field; Saves screen space and makes data easier to read;Cannot modify behavior or add a new one; Can add to a form; Example: Address 1 composite field consolidates multiple fields into one; Click to edit individual field values; If one of the fields in a composite field is Business Required then the form shows the composite field with the red asterisk and the field is required; Composite address field names end with "_composite", others don't have this suffix
Sub-grids (subgrids): Displays data from other records on a form (usually related records, such as contacts that relate to an account); Data is based on a view; Displayed as a list or a chart (not both together); Users can open records from the list and can add new records; Sub-grid properties include Name, Label, Display label on the form (y/n); Records (All Record Types or only Related Records); Entity; Default View; Edit and New buttons (create/edit views); Display Search Box (y/n; the Quick Find view is used for searching); Display Index (y/n; letters at bottom of grid, only for original forms); View Selector (Off, Show All Views, Show Selected Views); Default Chart; Show Chart Only (y/n); Display Chart Selection (y/n)
As of this writing (May 2014), Microsoft does not provide a supported way to programmatically filter the records that are listed in a sub-grid. Search online for "dynamics crm 2013 setparameter fetch" for examples of unsupported code that you can use for dynamic sub-grid record filtering.
Notes Control: Also known as the "Social Pane"; Used for displaying/adding Notes, Posts (activity feed posts), and Activities in a single component; Can filter Posts by source (created by system and/or user); Can mark activities as complete;
Spacer: Blank area to adding spacing to forms
Quick View Forms: Displays the details of a parent record in the form of a child record in a read-only format for convenient reference. For example, on a Contact form, you could add a quick view form from the Account entity to show some details of the company where the Contact works, such as the Account Number, Address, and Website fields.
Web Resources: Web Resources are Solution components that store different types of data to be reused from different parts of the system. Some types of Web Resource can be included on a form. Form-enabled Web Resources include graphics, HTML, and Silverlight resources.
IFrames (Inline Frames): An IFrame is a control that displays a webpage that is defined as the target URL for the IFrame. By putting an IFrame on a form, you can display data in Microsoft Dynamics CRM from any website that users have access to.
Bing Maps: Displays the location of the address of the record; Uses value from composite address field; Can use for entities Account, Contact, Lead, User, Quote, Order, Invoice, and Competitor
Modify Related Entity Navigation: You can control the navigation buttons/links for related entities that appear on the navigation bar for an entity record. See section "Modify Related Entity Navigation" below for a screen example.
Quick Create Forms:
Features: Used for faster way to create records. Can be added for custom entities (need to select "Allow Quick Create" option). Supports form scripting.
Limitations: Cannot assign security roles to Quick Create forms. Cannot add Web Resources or IFrames. Only custom activities support Quick Create forms. User cannot switch to a different Quick Create form. Cannot add the following components: sub-grid, quick view forms, web resources, iframe, notes, Bing maps. Has 1 tab and 3 sections: This is fixed (cannot add/remove tabs or sections).
Other: These are new in CRM 2013. They're launched (opened) by clicking the Create button in the navigation bar (top of screen) or clicking the + for a subgrid or lookup. The form order dictates the default Quick Create form. Used by tablets.
Form Automation:
You can write JavaScript to change (switch, toggle) a CRM form. Search for "Xrm.Page.ui.formSelector" in the SDK.
To get the ID (Guid) for a form, you can use the IE F12 developer tools to inspect the form selector drop down control and get the current form's ID from the HTML.
Misc Info:
You can add JavaScript code for the TabStateChange event that is triggered when a user expands or collapses a tab
For the Address form (customeraddress), there are three attributes hidden on the form by default: parentid, objecttypecode, addressnumber
Web Resources and IFrames can be slow to load; The recommendation is, when feasible, add those components to a collapsed tab so that CRM doesn't navigate/render them automatically
Form parameters: TODO
Form non-event dependencies: TODO
Sample Account Form
Sample Form Editor
Form Structure for Web Browsers
Sub-grid Example
This sub-grid rendered on a form has all options turned on (Display search box and View selector):
The plus (+) button allows you to add a new (create) record or relate an existing record, depending on whether the lookup attribute for which the sub-grid is showing records is set as Business Required or not. Thus, if you want the + button to always launch the Create form then make the related lookup required.
You can also add a new record by clicking the Search magnifying glass that appears and click the "+New" link.
The button to the right of the + is used to display the related records in the full "associate records" page view.
Modify Related Entity Navigation
1. Click "Navigation" to edit entity navigation. 2. Add or remove relationships. 3. Modify order and grouping. Rename groups. (You cannot delete or hide any of the groups nor add more than the existing five groups.) 4. Save and publish the form. Reload the entity record to see the changes to the navigation.
Sample Account Form
Sample Form Editor
Form Structure for Web Browsers
Sub-grid Example
This sub-grid rendered on a form has all options turned on (Display search box and View selector):The plus (+) button allows you to add a new (create) record or relate an existing record, depending on whether the lookup attribute for which the sub-grid is showing records is set as Business Required or not. Thus, if you want the + button to always launch the Create form then make the related lookup required.
You can also add a new record by clicking the Search magnifying glass that appears and click the "+New" link.
The button to the right of the + is used to display the related records in the full "associate records" page view.
Modify Related Entity Navigation
1. Click "Navigation" to edit entity navigation. 2. Add or remove relationships. 3. Modify order and grouping. Rename groups. (You cannot delete or hide any of the groups nor add more than the existing five groups.) 4. Save and publish the form. Reload the entity record to see the changes to the navigation.